/***
 * A mono color card stack
 */
package it.stessaro.lostcities.collection.pile;

import it.stessaro.lostcities.collection.Card;
import it.stessaro.lostcities.core.Costants;

public class ColorPile extends CardStack {

	private static final long serialVersionUID = 1L;
	private int color;
	private int weight;
	
	public ColorPile(int color) {
		super();
		this.color = color;
		weight = 0;
	}

	public String getColorString() {
		if (color == Costants.RED) {
			return "r";
		}else if (color == Costants.WHITE) {
			return "w";
		}else if (color == Costants.BLUE) {
			return "b";
		}else if (color == Costants.YELLOW) {
			return "y";
		}else{
			return "g";
		}
	}

	public int getColor(){
		return color;
	}

	public int value(){
		int value;
		if (this.size() == 0) {
			return 0;
		}
		value = -20;
		int moltiply = 1;
		for (Card card : this) {
			if (card.getCardValue() == 1 ) {
				moltiply++;
			}else {
				value = value + card.getCardValue();
			}
		}
		return value * moltiply;
	}
	
	public int expr_weight(){
		return weight + this.value();
	}
	public void addWeight(int w){
		weight = weight + w;
	}
	
	public String exp_valueStr(){
		return Integer.toString(this.value());
	}
}
